package com.wclass.mapper;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.wclass.entity.IndexSearchWord;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 首页搜索关键词 Mapper 接口
 * </p>
 *
 * @author SEN
 * @since 2019-03-11
 */
public interface IndexSearchWordMapper extends BaseMapper<IndexSearchWord> {

    /**
     * 获取热门搜索
     * @param page
     * @return
     */
    @Select("select w.word from index_search_word w group by w.word order by SUM(w.count)")
    List<IndexSearchWord> getHotIndexSearch(Pagination page);

}
